package cn.rengy.web.framework.sql;

import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.util.Assert;

import cn.rengy.tool.core.GenericTokenParser;

public class ParseSqlUtils {

	
	public static String parseSql(final String sql,SqlParameterSource sqlParameterSource) {
		Assert.notNull(sql, "SQL must not be null");
	    GenericTokenParser parser = new GenericTokenParser("${", "}", new MapSqlParameterHandler(sqlParameterSource));
		return parser.parse(sql);
	}
}
